package client.view;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ClientLoginWindow extends javax.swing.JFrame {
    private static final long serialVersionUID = 4654134312394317246L;
	private JLabel lblUsername;
	private JPanel jPanel1;
	private JLabel lblError;
	private JButton buttonLogin;
	private JTextField textFieldUsername;

	public ClientLoginWindow() {
		super();
		initGUI();
		setLocationRelativeTo(null);
	}
	
	private void initGUI() {
		try {
			GridBagLayout thisLayout = new GridBagLayout();
			thisLayout.rowWeights = new double[] {0.1, 0.0, 0.1, 0.0, 0.1};
			thisLayout.rowHeights = new int[] {7, 10, 7, 7, 7};
			thisLayout.columnWeights = new double[] {0.1};
			thisLayout.columnWidths = new int[] {7};
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(thisLayout);
			{
				jPanel1 = new JPanel();
				GridBagLayout jPanel1Layout = new GridBagLayout();
				getContentPane().add(jPanel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				jPanel1.setPreferredSize(new java.awt.Dimension(304, 96));
				jPanel1Layout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0};
				jPanel1Layout.rowHeights = new int[] {10, 15, 7, 10};
				jPanel1Layout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0};
				jPanel1Layout.columnWidths = new int[] {10, 15, 7, 7, 10};
				jPanel1.setLayout(jPanel1Layout);
				{
					lblUsername = new JLabel();
					jPanel1.add(lblUsername, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
					lblUsername.setText("Username");
					lblUsername.setPreferredSize(new java.awt.Dimension(52, 16));
				}
				{
					textFieldUsername = new JTextField();
					jPanel1.add(textFieldUsername, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					textFieldUsername.setPreferredSize(new java.awt.Dimension(322, 57));
					textFieldUsername.setBorder(BorderFactory.createTitledBorder(""));
				}
			}
			{
				buttonLogin = new JButton();
				getContentPane().add(buttonLogin, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
				buttonLogin.setText("Login");
				buttonLogin.setBorder(BorderFactory.createTitledBorder(""));
				buttonLogin.setFont(new java.awt.Font("Segoe UI",1,10));
			}
			{
				lblError = new JLabel();
				getContentPane().add(lblError, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 20, 0, 20), 0, 0));
				lblError.setText("Error");
				lblError.setForeground(new java.awt.Color(255,0,0));
			}
			pack();
			this.setSize(320, 208);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public JButton getButtonLogin()
	{
		return buttonLogin;
	}

	public JTextField getTextFieldUsername()
	{
		return textFieldUsername;
	}

	public JLabel getLblError() {
		return lblError;
	}

}
